import { lazy } from "react"
import { Navigate } from "react-router-dom"
const Home = lazy(() => import("../views/home"))
const My = lazy(() => import("../views/my"))
const Login = lazy(() => import("../views/login"))
const MainLayout = lazy(() => import("../views/mainLayout"))
const Order = lazy(() => import("../views/order"))
const OrderQuery = lazy(() => import("../views/orderQuery"))
export const routes = [
  {
    path: "/",
    element: <MainLayout></MainLayout>,
    children: [
      {
        path: "/home",
        element: <Home></Home>,
      },
      {
        path: "/my",
        element: <My></My>,
      },
      {
        path: "/",
        element: <Navigate to="/home"></Navigate>,
      },
    ],
  },
  {
    path: "/login",
    element: <Login></Login>,
  },
  {
    path: "/order",
    element: <Order></Order>,
  },
  {
    path: "order/query",
    element: <OrderQuery></OrderQuery>,
  },
]
